import django_filters
from .models import DjChef

class ChefFilter(django_filters.FilterSet):
    min_rating = django_filters.NumberFilter(field_name='rating', lookup_expr='gte')
    max_rating = django_filters.NumberFilter(field_name='rating', lookup_expr='lte')
    min_experience = django_filters.NumberFilter(field_name='years_of_experience', lookup_expr='gte')
    max_experience = django_filters.NumberFilter(field_name='years_of_experience', lookup_expr='lte')
    verification_status = django_filters.BooleanFilter(field_name='verification_status')
    specialty = django_filters.CharFilter(field_name='specialty', lookup_expr='icontains')
    city = django_filters.CharFilter(field_name='city', lookup_expr='iexact')
    user_state = django_filters.CharFilter(field_name='user_state', lookup_expr='iexact')
    
    class Meta:
        model = DjChef
        fields = ['min_rating', 'max_rating', 'min_experience', 'max_experience', 
                 'verification_status', 'specialty', 'city', 'user_state']